
-- CREATE database if NOT EXISTS `e_cms` default character set utf8mb4 collate utf8mb4_general_ci;
-- use `e_cms`;
-- SET NAMES utf8mb4;
-- SET FOREIGN_KEY_CHECKS = 0;
-- SET NAMES utf8mb4;
-- SET FOREIGN_KEY_CHECKS = 0;


-- ----------------------------
-- Table structure for cms_article
-- ----------------------------
DROP TABLE IF EXISTS `cms_article`;
CREATE TABLE `cms_article` (
  `article_id` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT '文章id',
  `title` varchar(255) COLLATE utf8mb4_general_ci NOT NULL COMMENT '文章标题',
  `content` text COLLATE utf8mb4_general_ci COMMENT '文章内容',
  `category_id` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT '分类id',
  `cover_image` varchar(256) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '封面图片',
  `summary` varchar(356) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '摘要',
  `create_by` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人',
  `create_at` datetime DEFAULT NULL COMMENT '创建时间',
  `update_by` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '修改人',
  `update_at` datetime DEFAULT NULL COMMENT '修改时间',
  `delete_flag` char(1) COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '删除状态',
  `tenant_id` varchar(32) COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '租户ID',
  `pinyin_code` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '拼音码',
  `wubi_code` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '五笔码',
  PRIMARY KEY (`article_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='文章表';


-- ----------------------------
-- Table structure for cms_attachment
-- ----------------------------
DROP TABLE IF EXISTS `cms_attachment`;
CREATE TABLE `cms_attachment` (
  `attachment_id` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT '附件id',
  `article_id` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT '文章id',
  `file_name` varchar(255) COLLATE utf8mb4_general_ci NOT NULL COMMENT '附件名称',
  `attachment_url` varchar(255) COLLATE utf8mb4_general_ci NOT NULL COMMENT '附件url',
  `file_size` varchar(255) COLLATE utf8mb4_general_ci NOT NULL COMMENT '附件大小',
  `create_by` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人',
  `create_at` datetime DEFAULT NULL COMMENT '创建时间',
  `update_by` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '修改人',
  `update_at` datetime DEFAULT NULL COMMENT '修改时间',
  `delete_flag` char(1) COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '删除状态',
  `tenant_id` varchar(32) COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '租户ID',
  `pinyin_code` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '拼音码',
  `wubi_code` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '五笔码',
  PRIMARY KEY (`attachment_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='文章附件表';

-- ----------------------------
-- Records of cms_attachment
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for cms_carousel
-- ----------------------------
DROP TABLE IF EXISTS `cms_carousel`;
CREATE TABLE `cms_carousel` (
  `carousel_id` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT '轮播id',
  `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '标题',
  `image_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '图片url',
  `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT '描述',
  `css` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'css',
  `jump_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '跳转的url',
  `sort_value` int DEFAULT '1' COMMENT '排序值',
  `tenant_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '租户ID',
  `create_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人',
  `create_at` datetime DEFAULT NULL COMMENT '创建时间',
  `update_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '修改人',
  `update_at` datetime DEFAULT NULL COMMENT '修改时间',
  `delete_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '删除状态',
  `pinyin_code` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '拼音码',
  `wubi_code` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '五笔码',
  PRIMARY KEY (`carousel_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='轮播图表';



-- ----------------------------
-- Table structure for cms_content_category
-- ----------------------------
DROP TABLE IF EXISTS `cms_content_category`;
CREATE TABLE `cms_content_category` (
  `category_id` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT '分类id',
  `category_name` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '分类名称',
  `icon` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '图标',
  `description` text COLLATE utf8mb4_general_ci COMMENT '描述',
  `type` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '类型',
  `parent_id` varchar(255) COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '父节点id',
  `sort_value` int DEFAULT '1' COMMENT '排序值',
  `tenant_id` varchar(32) COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '租户ID',
  `create_by` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人',
  `create_at` datetime DEFAULT NULL COMMENT '创建时间',
  `update_by` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '修改人',
  `update_at` datetime DEFAULT NULL COMMENT '修改时间',
  `delete_flag` char(1) COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '删除状态',
  `pinyin_code` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '拼音码',
  `wubi_code` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '五笔码',
  PRIMARY KEY (`category_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='内容分类表';


SET FOREIGN_KEY_CHECKS = 1;
